{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "data0 = [2, 4, 6.5, 8]\n",
    "arr0 = np.array(data0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2. , 4. , 6.5, 8. ])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr0\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3, 4],\n",
       "       [5, 6, 7, 8]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建多维数组\n",
    "data1 = [[1, 2, 3, 4], [5, 6, 7, 8]]\n",
    "arr1 = np.array(data1)\n",
    "arr1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfQAAAFzCAYAAADIY/vqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAtlklEQVR4nO3de5xdVXnw8d8zmWRyg1xIuIVLAgKViyIEBBFRpGCtikUaiLWK8r5YbbG2iuKlLbVarfVWi1rRIlIrQtVXfa2VWutLKgIaEOQil8g1iCSBkJCETCYzz/vH2oc5M5kkZ5Kcmczm9/18zmf2Wftyntmz5zx7rb322pGZSJKksa1jtAOQJEnbz4QuSVINmNAlSaoBE7okSTVgQpckqQZM6JIk1UDnaAewPWbNmpVz584d7TAkSRoxN95444rMnD24fEwn9Llz57J48eLRDkOSpBETEQ8MVW6TuyRJNWBClySpBkzokiTVgAldkqQaMKF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8tcF/1mb8Ebmoh1j8FvhoR72bgYyVfDFwQET3AGspjJ6VnJJ+2Jj0DRcRcyiNcDx/tWCTtGDa5S5JUA9bQJUmqAWvokiTVgAldkqQaMKFLklQDJnRJkmrAhC5JUg2Y0CVJqoH/D+6EcBuNZhe6AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 576x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 生成10万身高数据\n",
    "arr_height = np.random.normal(175, 10, size=100000)\n",
    "# 进行第一次采样，采样的样本赋值给sample_height，存储格式为ndarray\n",
    "sample_height = np.random.choice(arr_height, size=1, replace=True)\n",
    "# average 用来存储每次采样后计算的平均身高\n",
    "average = []\n",
    "# 进行10000轮循环采样，因为每次仅采集1个样本，所以整个过程可以视为有放回抽样\n",
    "n = 10000\n",
    "for round in range(n):\n",
    "    sample = np.random.choice(arr_height, size=1, replace=True)\n",
    "    sample_height = np.append(sample_height, sample)\n",
    "    average.append(np.average(sample_height))\n",
    "\n",
    "# 进行绘图，具体过程在第四章详细说明\n",
    "plt.figure(figsize=(8,6))\n",
    "plt.plot(np.arange(n), average, alpha=0.6, color='blue')\n",
    "plt.plot(np.arange(n), [175 for i in range(n)], alpha=0.6, color='red', linestyle='--')\n",
    "plt.xlabel(\"Sample Rounds\", fontsize=10)\n",
    "plt.ylabel(\"Average Height\", fontsize=10)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "11f1dc213e07634baa4c5c321dec03c05dafae643c50f20e6d1a492290c05dc2"
  },
  "kernelspec": {
   "display_name": "Python 3.9.7 64-bit",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
